package cluster

import akka.actor.{Actor, ActorRef, ActorSystem, Props}
import com.typesafe.config.ConfigFactory

/**
 * @Description: TODO
 * @Author: DJJ
 * @Date: 2019/12/13 11:31
 */
class Cluster3 extends Actor{
  override def receive: Receive = {
    case "start"=>println("Cluster2 start")
  }
}
object Cluster3 extends App{
  val config = ConfigFactory.parseString(
    s"""
       |akka.remote.netty.tcp.hostname="127.0.0.1"
       |akka.remote.netty.tcp.port=9992
        """.stripMargin).withFallback(ConfigFactory.load())//加载配置文件
  val sparkWoker = ActorSystem("Cluster", config)
  val woker: ActorRef = sparkWoker.actorOf(Props[Cluster3],"Cluster")
  woker ! "start"
}
